//
//  iOSIPViewController.m
//  iOSIP
//
//  Created by Ngoc on 29/12/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "iOSIPViewController.h"


@implementation iOSIPViewController

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

-(void) preparingGalleryToShow
{
    _gallery  = [[DnPhotoGallery alloc]initWithDelegate:self];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
    [_activityView startAnimating];
    [self performSelector:@selector(preparingGalleryToShow) withObject:nil afterDelay:2.0f];
    
}

-(void) galleryInitCompleted:(DnPhotoGallery *)gallery
{
    [_activityView stopAnimating];
    self.view = gallery.view;
    
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
